package mediatheque.model;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class DiversModel extends DocumentModel {
	

	private static final long serialVersionUID = -673046864428818632L;
	private static int NOMBRE_DIVERS = 0;
	
	public DiversModel() {
		super("Divers","N/A","N/A","N/A",true,null);
		NOMBRE_DIVERS++;
		setIdentifiant(genererIdentifiant());
	}

	private String genererIdentifiant() {
		return "DI-" + NOMBRE_DIVERS;
	}

	private void writeObject(ObjectOutputStream oos) throws IOException {
		oos.defaultWriteObject();
		oos.writeObject(new Integer(NOMBRE_DIVERS));
	}

	private void readObject(ObjectInputStream ois)
			throws ClassNotFoundException, IOException {
		ois.defaultReadObject();
		NOMBRE_DIVERS = (Integer) ois.readObject();
	}

}
